package com.lgy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lgy.dao.AdminlogDao;
import com.lgy.pojo.Adminlog;
import com.lgy.service.IAdminLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminLogServiceImpl implements IAdminLogService {

    @Autowired
    private AdminlogDao adminlogDao;
    @Override
    public int deleteByPrimaryKey(Integer logId) {
        return adminlogDao.deleteByPrimaryKey(logId);
    }

    @Override
    public int insert(Adminlog record) {
        return adminlogDao.insert(record);
    }

    @Override
    public int insertSelective(Adminlog record) {
        return adminlogDao.insertSelective(record);
    }

    @Override
    public Adminlog selectByPrimaryKey(Integer logId) {
        return adminlogDao.selectByPrimaryKey(logId);
    }

    @Override
    public int updateByPrimaryKeySelective(Adminlog record) {
        return adminlogDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Adminlog record) {
        return adminlogDao.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo<Adminlog> findAllByCompanyId(Integer companyId, Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        List<Adminlog> adminlogList = adminlogDao.findAllByCompanyId(companyId);
        PageInfo<Adminlog> pageInfo = new PageInfo<>(adminlogList);
        return pageInfo;
    }
}
